package com.gh.pattern.singleton.lazy;

public class LazyTwo {

    private LazyTwo(){

    }

    private static LazyTwo lazy = null;

    //这种用了synchronized的会降低效率，问题还不少，可以试试第三种方法
    public static synchronized LazyTwo getInstance() {
        if(lazy == null) {
            lazy = new LazyTwo();
        }
        return lazy;
    }
}
